<template>
	<view class="page">
		<tpf-nav-bar status-bar hasTitle :fixedHeight="navBarConfig.fixedHeight" :left="navBarConfig.left" :title="navBarConfig.title" :right="navBarConfig.right" @iconTap="navBarIconTap">
			<view class="nav-bar-bg"></view>
		</tpf-nav-bar>
		
		<!-- 默认地址 -->
		<view class="tpf-defaut-address" v-if="!isEmptyGoods">
			<navigator :url="'/pages/ucenter/address/address?trigger='+trigger" class="flex">
				<tpf-icon :fontFamily="addressConfig.fontFamily" :text="addressConfig.left.text"></tpf-icon>
				<view class="tpf-address-info flex-1" v-if="!isEmptyAddress">
					<view class="flex flex-align-center">
						<view class="consignee">{{defaultAddress.consignee}}</view>
						<view class="mobile">{{defaultAddress.mobile}}</view>
					</view>
					<view class="address">{{defaultAddress.address}}</view>
				</view>
				<view class="tpf-empty-address flex-1" v-else>{{addressConfig.emptyTip}}</view>
				<tpf-icon :fontFamily="addressConfig.fontFamily" :text="addressConfig.right.text"></tpf-icon>
			</navigator>
		</view>
		
		<!-- 产品列表 -->
		<view class="tpf-cart-list">
			<tpl-settlement :cartGoodsList="cartGoodsList" @changeNumber="changeNumber"></tpl-settlement>
		</view>
		<!-- 结算栏目 -->
		<view class="tpf-settlement-footer-bar-wrap" v-if="!isEmptyGoods">
			<!-- 占位 -->
			<view class="footer-bar__seat"></view>
			<view class="tpf-settlement-footer-bar flex flex-pack-center">
				<view class="total">
					<view class="total-label">合计：</view>
					<view class="total-price">
						<tpl-price :price="totalMoney" :priceStyle="'display:initial'"></tpl-price>
					</view>
				</view>
				<view class="quantity flex-1">共<text class="number">{{productTotalCount}}</text>件</view>
				<view class="submit-order" @tap="settlement">提交订单</view>
			</view>
		</view>
	</view>
</template>

<script src="./settlement.js"></script>

<style lang="scss" scoped src="./settlement.scss"></style>
